let listLoad = require('../../common/mixinList');
Page({
    behaviors: [listLoad],
    data: {
        navInfo: '',
        reqUrl: '/supplier/com/product/index', //请求可以选择的商品列表url
        login: true,
    },
    onLoad: function() {
        this.setData({
            navInfo: getApp().globalData.navInfo
        })
        this.getList(true)
    },
    getParamsData() {
        if (this.data.searchText) {
            return { so: this.data.searchText }
        }
        return {}
    },
    //选择商品
    choose({ mark }) {
        const { index } = mark
        if (index == undefined) return
        const eventChannel = this.getOpenerEventChannel()
        eventChannel.emit('acceptDataFromOpenedPage', { goodsInfo: this.data.list[index] })
        wx.navigateBack()
    },
    pageBack() {
        wx.navigateBack()
    },
})